package com.mt.components.general {
	
	import flash.events.KeyboardEvent;
	import flash.ui.Keyboard;
	
	import mx.collections.ArrayCollection;
	import mx.controls.DataGrid;
	
	/**
	 * 类名称：EDataGrid<br> 
	 * 类描述：<br>
	 * 创建人：马腾<br>
	 * 创建时间：Nov 22, 2012 4:22:23 PM<br>
	 * 修改人：马腾<br>
	 * 修改时间：Nov 22, 2012 4:22:23 PM<br>
	 */
	public class MDataGrid extends DataGrid {
		
		override protected function commitProperties():void{
			super.commitProperties();
			addEventListener(KeyboardEvent.KEY_UP , keyHander);
			this.allowMultipleSelection = true;
		}
		
		protected function keyHander(event:KeyboardEvent):void {
			if(event.ctrlKey && event.keyCode == Keyboard.A){
				if(this.dataProvider && this.dataProvider is ArrayCollection){
					this.selectedItems = (this.dataProvider as ArrayCollection).toArray();
				}
			}
		}
	}
}